package com.ossjk.oa.attendance.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ossjk.oa.attendance.entity.Atdtable;
import com.ossjk.oa.attendance.vo.AtdtableVo;
import org.apache.ibatis.annotations.Select;

/**
 * Mapper 接口
 * 
 * @Author Datou
 * @Version 1.0, 2020-05-23
 * @See
 * @Since com.ossjk.oa.attendance.mapper
 * @Description: TODO
 */
public interface AtdtableMapper extends BaseMapper<Atdtable> {
	List selectVoPage(Page page, @Param("ew") Wrapper wrapper);

	AtdtableVo selectVo(@Param("ew") Wrapper wrapper);
	List selectKQTable(Wrapper wrapper);

	@Select("select DISTINCT (year*100+month) from Atdtable where (year*100+month)<(select min(year*100+month) from Atdtable where(year*100+month) = #{mth}) order by   (year*100+month) desc")
	Integer selectPreMth(Integer mth);

	@Select("select   DISTINCT (year*100+month) from Atdtable where (year*100+month)>(select max(year*100+month) from Atdtable where (year*100+month)= #{mth}) order by (year*100+month)")
	Integer selectNextMth(Integer mth);

}
